﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Text;
using NLog;

namespace Gollie.Payment.Targetpay
{
	public partial class BankWireReportHandler : System.Web.UI.Page
	{
		private static Logger logger = LogManager.GetCurrentClassLogger();

		protected void Page_Load(object sender, EventArgs e)
		{
			logger.Info("Bankwire report handler called...{0}", this.Request.Url.PathAndQuery);

			StringBuilder hasher = new StringBuilder(64);

			string kenmerk = this.Request["trxid"]; //targetpay
			string rtlo = this.Request["rtlo"];
			string amountdue = this.Request["amountdue"];
			string amountpaid = this.Request["amountpaid"];
			string checksum = this.Request["checksum"];

			try
			{
				BankWireHandler bankWireHandler = new BankWireHandler(kenmerk, rtlo, amountdue, amountpaid, checksum);

				bankWireHandler.Handle();
			}
			catch (Exception ex)
			{
				logger.ErrorException("Bankwire report error: ", ex);
			}
		}
	}
}